package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SsActivityMapper;
import com.ruoyi.system.domain.SsActivity;
import com.ruoyi.system.service.ISsActivityService;

/**
 * 活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-27
 */
@Service
public class SsActivityServiceImpl implements ISsActivityService 
{
    @Autowired
    private SsActivityMapper ssActivityMapper;

    /**
     * 查询活动
     * 
     * @param activityId 活动主键
     * @return 活动
     */
    @Override
    public SsActivity selectSsActivityByActivityId(Long activityId)
    {
        return ssActivityMapper.selectSsActivityByActivityId(activityId);
    }

    /**
     * 查询活动列表
     * 
     * @param ssActivity 活动
     * @return 活动
     */
    @Override
    public List<SsActivity> selectSsActivityList(SsActivity ssActivity)
    {
        return ssActivityMapper.selectSsActivityList(ssActivity);
    }

    /**
     * 新增活动
     * 
     * @param ssActivity 活动
     * @return 结果
     */
    @Override
    public int insertSsActivity(SsActivity ssActivity)
    {
        ssActivity.setCreateTime(DateUtils.getNowDate());
        return ssActivityMapper.insertSsActivity(ssActivity);
    }

    /**
     * 修改活动
     * 
     * @param ssActivity 活动
     * @return 结果
     */
    @Override
    public int updateSsActivity(SsActivity ssActivity)
    {
        ssActivity.setUpdateTime(DateUtils.getNowDate());
        return ssActivityMapper.updateSsActivity(ssActivity);
    }

    /**
     * 批量删除活动
     * 
     * @param activityIds 需要删除的活动主键
     * @return 结果
     */
    @Override
    public int deleteSsActivityByActivityIds(Long[] activityIds)
    {
        return ssActivityMapper.deleteSsActivityByActivityIds(activityIds);
    }

    /**
     * 删除活动信息
     * 
     * @param activityId 活动主键
     * @return 结果
     */
    @Override
    public int deleteSsActivityByActivityId(Long activityId)
    {
        return ssActivityMapper.deleteSsActivityByActivityId(activityId);
    }
}
